package com.zzxx.utils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class String2Date {
    public static Date stringToDate(String now, String pattern){
        SimpleDateFormat sdf = new SimpleDateFormat(pattern);
        Date date = null;
        try {
            date = sdf.parse(now);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return date;
    }
}
